package ai.plantdata.FrontControllerPattern.dispatcher;

import ai.plantdata.FrontControllerPattern.view.HomeView;
import ai.plantdata.FrontControllerPattern.view.StudentView;

/**
 * @Author: WangHui
 * @Date: 2020/12/24 16:05
 * @Description:
 */
public class Dispatcher {
    private StudentView studentView;
    private HomeView homeView;

    public Dispatcher() {
        this.studentView = new StudentView();
        this.homeView = new HomeView();
    }

    public void dispatch(String request){
        if(request.equalsIgnoreCase("STUDENT")){
            studentView.show();
        }else{
            homeView.show();
        }
    }
}
